{% for config in themeConfig.blocks.left|default([]) %}
  {% set code = config.code %}
  {% if code == 'footer-link' %}
    {% set category = config.categoryId|default(0) ? data('Category', {categoryId: config.categoryId})  : null %}
    {% include 'default/' ~ code ~ '.html.twig' with {config:config, category: category} %}
  {% endif %}
{% endfor %}

<footer class="es-footer">
  <div class="copyright">
    <div class="container">
      {% include "powered-by.html.twig" %}

      {{ setting('site.analytics')|raw }}

      {% if setting('siteTrace.enabled')|default(false) %}
        {{ setting('siteTrace.script')|raw }}
      {% endif %}

      <a class="mlm" href="{{ path('course_set_archive') }}">{{ 'homepage.footer.archive'|trans }}</a>
      <div class="mts">
        {% if setting('site.copyright') %}
          {{ 'homepage.footer.course_copyright'|trans({'%copyRightUrl%':setting('site.copyright')})|raw }}
        {% endif %}
        {% if setting('qualifications.recordCode') |default('') %}
          <a class="license-picture">
            <img src="{% if setting('qualifications.recordPicture') %}{{ asset(setting('qualifications.recordPicture')) }}
                      {% else %}{{ filepath('','gongan.png' ) }}{% endif %}" style="width: 20px;height: 20px;">
          </a>
          <a class="mlm" {% if setting('qualifications.recordUrl') |default('') %}
            href="{{ setting('qualifications.recordUrl') }}"
          {% endif %}
             target="_blank">
            {{ setting('qualifications.recordCode') }}
          </a>
        {% endif %}
      </div>

        <div class="mlm">
          {% if setting('qualifications.icp') %}
            <a class="mlm" href={{ setting('qualifications.icpUrl')|default('https://beian.miit.gov.cn') }} target="_blank">
              {{ setting('qualifications.icp') }}
            </a>
          {% endif %}
        </div>

      {% if setting('license.license_picture') and setting('license.license_name') %}
        {% if setting('license.license_url') %}
          <a id="license-picture" href={{ setting('license.license_url')| default('/') }} target="_blank">
            <img src="{{ asset(setting('license.license_picture')) }}">
          </a>
          <a class="mlm" href={{ setting('license.license_url')|default('/') }} target="_blank">
            {{ setting('license.license_name') }}
          </a>
        {% else %}
          <a id="license-picture"><img src="{{ asset(setting('license.license_picture')) }}"></a>
          <a>{{ setting('license.license_name') }}</a>
        {% endif %}
      {% endif %}

      {% for permit in setting('permits.permits') %}
        <div>
          {% if permit.name and permit.record_number %}
            {% if permit.picture %}
              <a class="mlm"
                 href={{ fileurl('../'~permit.picture, null) |default('/') }} target="_blank">{{ permit.name }}</a>
              <a class="mlm"
                 href={{ fileurl('../'~permit.picture, null) |default('/') }} target="_blank">{{ permit.record_number }}</a>
            {% else %}
              <a class="mlm">{{ permit.name }}</a>
              <a class="mlm">{{ permit.record_number }}</a>
            {% endif %}
          {% endif %}
        </div>
      {% endfor %}
    </div>
  </div>
</footer>
